<?php
/**
 * 合同产品
 * @author Administrator
 *
 */
class Application_Model_DbTable_Contractproduct extends Application_Model_DbTable_Base
{
    protected $_name = 'contract_product';

	/**
	 * 取得列表
	 */
	public function getUserListForFlex($pageM = NULL){
		$rows = $this->jqfetchAll($pageM);
		return $rows;
	}

	/**
	 * 统一的添加下拉列表项目
	 * @param Application_Form_Base $formM
	 */
	public static function setMultiOptions(Application_Form_Base $formM){
		
		//添加产品
		$product_idE = $formM->getElement("product_id");
		if($product_idE){
			$product_idM = new Application_Model_DbTable_Product();
			$product_idL = $product_idM->fetchAll();
			$product_idD = array();
			foreach ($product_idL as $product_id){
				$product_idD[$product_id["id"]] = $product_id["name_cn"];
			}
			$product_idE->setMultiOptions($product_idD);
		}
		
		return $formM;
	}
}

